<?php
	$cookie = new cookieClass();
	$user = new dataUSER();
	$user->connect();
	
	if(!empty($_POST['username']) && !empty($_POST['password'])){
		$user= $user->loginUser($_POST['password'],$_POST['username']);
		if($user){
			$_SESSION['User'] = $user;
			$cookie->setCookiesExpiry($_SESSION['User']['LOGIN'],$_SESSION['User']['PASSWORD']);
		}
	}

	$controller->redirect('mainAdvertiser');
?>